package com.flying.cattle.controller;

import com.flying.cattle.redismq.PublishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/msg")
public class MsgController {

    @Autowired
    PublishService publisher;


    @RequestMapping("/send")
    public void sendMessage(@RequestParam String topic, @RequestParam Object data) {
        System.out.println(data);
        publisher.publish(topic,data);
    }
}
